package com.atguigu.flink;

import com.streamxhub.streamx.flink.core.StreamEnvConfig;
import com.streamxhub.streamx.flink.core.java.source.KafkaSource;
import com.streamxhub.streamx.flink.core.scala.StreamingContext;

/**
 * @Author lzc
 * @Date 2022/3/30 15:08
 */
public class StreamXKafka {
    public static void main(String[] args) {
        // 传入main函数的参数, main函数参数中application.yml的地址
        StreamEnvConfig config = new StreamEnvConfig(args, null);
        StreamingContext ctx = new StreamingContext(config);
    
        /*new KafkaSource<String>(ctx)
            .getDataStream()
            .map(record -> record.value())
            .print();*/
    
        new KafkaSource<String>(ctx)
            .topic("s1")
            .getDataStream()
            .map(record -> record.value())
            .print("s1");
    
        new KafkaSource<String>(ctx)
            .topic("s2")
            .getDataStream()
            .map(record -> record.value())
            .print("s2");
    
        ctx.start();
    }
}
